import { EnumSchema } from '@/utils/common/types';
import { PresetColorEnum } from '@/enums/colorEnum';
// import { useI18n } from '@/hooks/web/useI18n';

//#region 打印报告类型枚举
/** 打印报告类型枚举 */
export enum PrintReportTypeEnum {
  /** FastReport */
  FastReport = 1,
}
//#endregion

/** 打印报告类型实体 */
export class PrintReportTypeEntity {
  /** 打印报告类型 */
  PrintReportType: PrintReportTypeEnum;
  /** 显示描述 */
  Display: string;
  /** 颜色 */
  Color?: PresetColorEnum | string;

  constructor(printReportType: PrintReportTypeEnum, color?: PresetColorEnum | string) {
    // const { t } = useI18n();
    this.PrintReportType = printReportType;
    this.Color = color;
    switch (printReportType) {
      case PrintReportTypeEnum.FastReport:
        this.Display = 'FastReport';
        // this.Display = t('enum.databaseObjectType.table');
        this.Color = this.Color ? this.Color : PresetColorEnum.Orange;
        break;
    }
  }
}

//#region 获取打印报告类型枚举架构
/**
 * 获取打印报告类型枚举架构
 */
export function getPrintReportTypeEnumSchema(enableTag = true): EnumSchema[] {
  const enumSchema: EnumSchema[] = [];
  const entities: PrintReportTypeEntity[] = [
    new PrintReportTypeEntity(PrintReportTypeEnum.FastReport),
  ];
  entities.forEach((item) => {
    enumSchema.push({
      key: item.PrintReportType as number,
      label: item.Display,
      value: item.PrintReportType as number,
      tag: enableTag,
      tagColor: item.Color,
    });
  });
  return enumSchema;
}
//#endregion
